/*
archer
ANES social media 2020 study
views on Fox pre/post 2020 election
*/

* load ANES 2020 Social Media Study data 

tab weight_pre
tab weight_post


tab trustfox
tab trustfox, nol
recode trustfox (5=1 "A great deal")(4=.75)(3=.5)(2=.25)(1=0 "Not at all")(else=.), gen(trustfox01)
tab trustfox01

tab w2trustfox
tab w2trustfox, nol
recode w2trustfox (5=1 "A great deal")(4=.75)(3=.5)(2=.25)(1=0 "Not at all")(else=.), gen(w2trustfox01)
tab w2trustfox01

tab pid7x
tab pid7x, nol
recode pid7x (1 2 3 = 1 "Dem")(5 6 7 = 0 "Rep")(else=.), gen(demrep)
tab demrep

tab w2pid7x
tab w2pid7x, nol
recode w2pid7x (1 2 3 = 1 "Dem")(5 6 7 = 0 "Rep")(else=.), gen(w2demrep)
tab w2demrep


***************

svyset [pweight=weight_pre]
svy : mean trustfox01
svy : mean trustfox01 if demrep==0 
svy : mean trustfox01 if demrep==1 

svyset [pweight=weight_post]
svy : mean w2trustfox01
svy : mean w2trustfox01 if w2demrep==0 
svy : mean w2trustfox01 if w2demrep==1 


ttest trustfox01=w2trustfox01 if demrep==0 
ttest trustfox01=w2trustfox01 if w2demrep==0 
